package com.cosmoplat.xikai.business.domain.mes.req;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName MesMaterialDistribution
 * @Description 2.15 物料叫料接口
 * @Author wdf
 * @Date 2025/1/10
 */
@Data
public class MesMaterialDistributionRequest {


    @ApiModelProperty(value = "叫料任务号", required = true, example = "DLRW001")
    private String code;

    /**
     * 派工单ID
     * 派工单ID和派工任务ID，叫料、送料、转序不能同时为空
     **/
    @ApiModelProperty(value = "派工单ID", required = true, example = "WO001")
    private String orderID;


    /**
     *
     * 派工单ID和派工任务ID, 叫料、送料、转序不能同时为空
     **/
    @ApiModelProperty(value = "派工任务ID", required = true, example = "WOT001")
    private String taskID;

    // 非必填
    @ApiModelProperty(value = "顺序号", example = "1")
    private String sequenceNo;

    /**
     * 枚举类型（待定），
     * 1退托盘
     * 2叫料
     * 3送料
     * 4转序
     **/
    @ApiModelProperty(value = "配送类型", example = "")
    private String deliveryType;

    @ApiModelProperty(value = "工序", example = "组装/焊接")
    private String processStep;

    /**
     * 退托盘、送料、转序不能为空
     **/
    @ApiModelProperty(value = "起始位置", example = "仓库A区")
    private String startLocation;

    /**
     * 转序、叫料不能为空
     **/
    @ApiModelProperty(value = "终止位置", example = "生产线2号")
    private String endLocation;

    @ApiModelProperty(value = "配送物料", example = "螺栓M8")
    private String material;

    @ApiModelProperty(value = "配送数量", example = "100")
    private BigDecimal quantity;

    @ApiModelProperty(value = "创建人", example = "张三")
    private String creator;

    @ApiModelProperty(value = "创建时间", example = "2025-01-10 16:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime = new Date();

    @ApiModelProperty(value = "最后修改时间", example = "2025-01-10 16:01:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastModifiedTime = new Date();

    @Getter
    public enum DeliveryTypeEnum {
        RETURN_TRAY("1", "退托盘"),
        DISTRIBUTION("2", "叫料"),
        DELIVERY("3", "送料"),
        TRANSFER("4", "转序");

        private String code;
        private String desc;

        DeliveryTypeEnum(String code, String desc) {
            this.code = code;
            this.desc = desc;
        }
    }
}
